import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { request, upload } from '@/api/request'
import './styles/normalize.css'
import 'lib-flexible/flexible'
import { Icon, Dialog, Toast, Loading, Overlay, PullRefresh, List, Col, Row, Lazyload, Notify, Calendar, ActionSheet, Cell, CellGroup, Popup, Swipe, SwipeItem } from 'vant';
import * as filters from './filters' // global filters

import './styles/iconfont/iconfont.css'

import Echarts from 'echarts'
Vue.prototype.echarts = Echarts
Vue.use(Echarts)



Vue.use(Icon)
Vue.use(Dialog)
Vue.use(Toast)
Vue.use(Loading);
Vue.use(Overlay);
Vue.use(PullRefresh);
Vue.use(List);
Vue.use(Col);
Vue.use(Row);
Vue.use(Lazyload);
Vue.use(Calendar);
Vue.use(ActionSheet);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(Popup);
Vue.use(Swipe);
Vue.use(SwipeItem);

Vue.config.productionTip = false
Vue.prototype.$request = request


Vue.directive('focus', {
  // 当被绑定的元素插入到 DOM 中时……
  inserted: function (el) {
    // 聚焦元素
    el.focus()
  }
})


// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')